package com.citybox.infrastructure.aliyun.persistence.service.impl;

import com.citybox.domain.aliyun.ALiYunAuthDo;
import com.citybox.infrastructure.aliyun.persistence.service.ALiYunService;
import com.citybox.shared.utils.aliyun.ALiYunUtils;
import com.citybox.shared.web.domain.R;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

@Slf4j
@Service
public class ALiYunServiceImpl implements ALiYunService {

    @Resource
    private ALiYunUtils aLiYunUtils;

    @Override
    public R<Map<String, Object>> userRealNameAuth(ALiYunAuthDo aLiYunAuthDo) {
        try {
            Map<String, Object> resultMap = aLiYunUtils.realNameAuth(aLiYunAuthDo.getName(), aLiYunAuthDo.getIdNo());

            return R.ok(resultMap);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
